<?php
//pdf

ini_set('max_execution_time',0);
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
// 设置文档信息
$pdf->SetCreator('Helloweba');
$pdf->SetAuthor('yueguangguang');
$pdf->SetTitle('Welcome to ww.toushibao.com!');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, PHP');
// 设置页眉和页脚信息
$pdf->SetHeaderData('img/logo_zh_cn.png', 30, 'www.toushibao.com', '致力于APM技术在中国的应用',
    array(0,64,255), array(0,64,128));
$pdf->setFooterData(array(0,64,0), array(0,64,128));
// 设置页眉和页脚字体
$pdf->setHeaderFont(Array('stsongstdlight', '', '10'));
$pdf->setFooterFont(Array('helvetica', '', '8'));
// 设置默认等宽字体
$pdf->SetDefaultMonospacedFont('courier');
// 设置间距
$pdf->SetMargins(15, 27, 15);
$pdf->SetHeaderMargin(5);
$pdf->SetFooterMargin(10);
// 设置分页
$pdf->SetAutoPageBreak(TRUE, 25);
// set image scale factor
$pdf->setImageScale(1.25);
// set default font subsetting mode
$pdf->setFontSubsetting(true);
//设置字体
$pdf->SetFont('stsongstdlight', '', 8);
$pdf->AddPage();
$title = '<h2 style="text-align: center">'.'标题'.'</h2>';
//                            $pdf->writeHTML(0,$title,'', 0, 'L', true, 0, false, false, 0);
$pdf->writeHTML($title,true,false,false,false,'');

$table='<br><br>'.'test';

$pdf->writeHTML($table,true,false,false,false,'');

$pdf_name='APP-'.time().'.pdf';
array_push($file_names,$pdf_name);
$pdf->Output($pdf_name, 'F');


//word

header("Content-type:text/csv");
header("Content-Disposition:attachment;filename=".$filename);
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');

echo  '<h2 style="text-align: center">'.'标题'.'</h2><br/><br/>';
echo 'test html';
